package main

import (
	"bufio"
	"fmt"
	"io"
	"time"

	"gitee.com/cjianwen/go/socks/v2"
)

func main() {
	svr := socks.NewSocketServer(1234)
	svr.SocketReadHnalder = func(conn *socks.SockConn, reader *bufio.Reader) {
		io.Copy(conn, reader)
	}

	if err := svr.Open(); err != nil {
		fmt.Println("server open error: ", err)
	} else {
		fmt.Println("echo listen port: 1234")
	}
	for {
		time.Sleep(time.Second)
	}
}
